<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>酒店详情</title>
<!-- 此文件为了显示Demo样式，项目中不需要引入 -->
   <link href="__PUBLIC__/assets/css/bs3/dpl.css" rel="stylesheet">
    <link href="__PUBLIC__/assets/css/bs3/bui.css" rel="stylesheet">
</head>
<body>
  <div class="demo-content">
    <form class="form-horizontal">
        <div class="row" style="margin-top:24px">
          <div class="control-group span8">
            <label class="control-label">酒店名称：</label>
            <div class="controls">
                <input type="hidden" name="id" value="{$data[0]['hotel_id']}"/>
              <input name="title" data-tip='{"text":"例:御庭大酒店","iconCls":"icon icon-home"}'  type="text" class="input-normal control-text" value="{$data[0]['title']}">
            </div>
          </div>
        </div>
          <div class="row">
          <div class="control-group span8">
            <label class="control-label">联系方式：</label>
            <div class="controls">
              <input name="phone"  data-tip='{"text":"例:13612345678","iconCls":"icon icon-envelope"}'  type="text" class="input-normal control-text" value="{$data[0]['phone']}">
            </div>
          </div>
        </div>
        <div class="row"> 
          <div class="control-group span15">
            <label class="control-label">地理位置：</label>
            <div class="controls">
              <input name="address"  data-tip='{"text":"例:浙江省温州市瓯海区XXXXXX","iconCls":"icon icon-map-marker"}'  type="text" class="input-large control-text" value="{$data[0]['location']}">
            </div>
          </div>
        </div>
         <div class="row">
          <div class="control-group span15">
            <label class="control-label">酒店设施：</label>
            <div class="controls">
              <input name="facilities" data-tip='{"text":"酒店设施多个以英文逗号分隔","iconCls":"icon icon-tag"}'  type="text" class="input-large control-text" value="{$data[0]['facilities']}">
            </div>
          </div>
        </div>
        <div class="row">
          <div class="control-group span15">
            <label class="control-label">酒店介绍：</label>
            <div class="controls control-row4">
              <textarea name="about"  data-tip='{"text":"例:某某酒店是省内XXXX坐落于XXXX地段"}' class="input-large" type="text">{$data[0]['about']}</textarea>
            </div>
          </div>
        </div>
        <div class="row form-actions actions-bar">
            <div class="span13 offset3 ">
              <button name="save" type="button" class="button button-primary">保存</button>
              <input name="reset" type="reset" class="button">重置</button>
            </div>
        </div>
    </form>
  <script src="__PUBLIC__/assets/js/jquery-1.8.1.min.js"></script>
  <script src="__PUBLIC__/assets/js/bui.js"></script>
<!-- script start --> 
    <script type="text/javascript">
          var Calendar = BUI.Calendar,
          Form = BUI.Form;
          var datepicker = new Calendar.DatePicker({
            trigger:'.calendar',
            autoRender : true
          });
 
        var form = $('form')[0],
          tips = Form.Tips({
            form : form
          });
        tips.render();
        $('[name=save]').click(function(){
           var id=$('[name=id]').val();
           var title=$('[name=title]').val();
           var phone=$('[name=phone]').val();
           var address=$('[name=address]').val();
           var facilities=$('[name=facilities]').val().replace(/，/g,",");
           var about=$('[name=about]').val();
           $.post("{:U('Hotel/changedetail')}",{id:id,title:title,phone:phone,address:address,facilities:facilities,about:about},function(result){
               eval("value="+result);
               if(value.code='0000'){
                   var msg='<h4>'+value.message+'</h4>'+'<p class="auxiliary-text">您已成功添加/修改酒店详情，更改将立即生效</p>';
                   BUI.Message.Alert(msg,'success');
               }else{
                   var msg='<h4>'+value.message+'</h4>'+'<p class="auxiliary-text">修改失败，请按要求进行填写。</p>';
                   BUI.Message.Alert(msg,'error');
               }
           })
        })
        $('[name=reset]').click(function(){
             $('[name=title]').val("");
             $('[name=phone]').val("");
             $('[name=address]').val("");
             $('[name=facilities]').val("");
             $('[name=about]').val("");
        })
    </script>
<!-- script end -->
  </div>
</body>
</html>